// 本文件用于：入口文件
import PageFrame from '@/page-frame';
import store from '@/store';
import { setUserInfo } from '@/store/slice/user';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';

const root = createRoot(document.getElementById('root')!);
root.render(
  <Provider store={store}>
    <PageFrame></PageFrame>
  </Provider>,
);

window.unmount = () => {
  root.unmount();
};

window.microApp.addGlobalDataListener((data: any) => {
  console.log('data', data);
  store.dispatch(setUserInfo(data));
});
